package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.domain.vo.ReceivableVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ReceivableMapper;
import com.ruoyi.system.domain.Receivable;
import com.ruoyi.system.service.IReceivableService;

/**
 * 应收款Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-18
 */
@Service
public class ReceivableServiceImpl implements IReceivableService 
{
    @Autowired
    private ReceivableMapper receivableMapper;

    /**
     * 查询应收款
     * 
     * @param id 应收款主键
     * @return 应收款
     */
    @Override
    public Receivable selectReceivableById(Long id)
    {
        return receivableMapper.selectReceivableById(id);
    }

    /**
     * 查询应收款列表
     * 
     * @param receivable 应收款
     * @return 应收款
     */
    @Override
    public List<ReceivableVo> selectReceivableList(Receivable receivable)
    {
        return receivableMapper.selectReceivableList(receivable);
    }

    /**
     * 新增应收款
     * 
     * @param receivable 应收款
     * @return 结果
     */
    @Override
    public int insertReceivable(Receivable receivable)
    {
        receivable.setCreateTime(DateUtils.getNowDate());
        return receivableMapper.insertReceivable(receivable);
    }

    /**
     * 修改应收款
     * 
     * @param receivable 应收款
     * @return 结果
     */
    @Override
    public int updateReceivable(Receivable receivable)
    {
        return receivableMapper.updateReceivable(receivable);
    }

    /**
     * 批量删除应收款
     * 
     * @param ids 需要删除的应收款主键
     * @return 结果
     */
    @Override
    public int deleteReceivableByIds(Long[] ids)
    {
        return receivableMapper.deleteReceivableByIds(ids);
    }

    /**
     * 删除应收款信息
     * 
     * @param id 应收款主键
     * @return 结果
     */
    @Override
    public int deleteReceivableById(Long id)
    {
        return receivableMapper.deleteReceivableById(id);
    }
}
